package cn.iocoder.an.module.business.dal.mysql.storeinitbackup;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.storeinitbackup.StoreInitBackupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.storeinitbackup.vo.*;

/**
 * 库存台账备份 Mapper
 *
 * @author zzy
 */
@Mapper
public interface StoreInitBackupMapper extends BaseMapperX<StoreInitBackupDO> {

    default PageResult<StoreInitBackupDO> selectPage(StoreInitBackupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreInitBackupDO>()
                .likeIfPresent(StoreInitBackupDO::getCustomerAccount, reqVO.getCustomerAccount())
                .eqIfPresent(StoreInitBackupDO::getDrawingNumber, reqVO.getDrawingNumber())
                .likeIfPresent(StoreInitBackupDO::getProductName, reqVO.getProductName())
                .eqIfPresent(StoreInitBackupDO::getBackupDate, reqVO.getBackupDate())
                .betweenIfPresent(StoreInitBackupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreInitBackupDO::getId));
    }

}